// LoadPluginException.cs
// 
// Copyright © 2009 FreeZzaph
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

using System;
using System.Collections.Generic;

namespace LibFreeZzaph
{
	
	/// <summary>
	/// Exception thrown if there is a problem loading the plug-ins.
	/// </summary>
	public sealed class LoadPluginException : Exception
	{
		List<LoadPluginException> exceptionList;
		
		/// <summary>
		/// Initializes a new instance of the LoadPluginException class with
		/// an error message.
		/// </summary>
		/// <param name="message">
		/// A description of what caused the exception to be thrown.
		/// </param>
		public LoadPluginException(string message)
			: base(message) {}
		
		/// <summary>
		/// Initializes a new instance of the LoadPluginException class with
		/// an error message and an inner exception.
		/// </summary>
		/// <param name="message">
		/// A description of what caused the exception to be thrown.
		/// </param>
		/// <param name="innerException">
		/// The exception that caused this exception to be thrown.
		/// </param>
		public LoadPluginException(string message, Exception innerException)
			: base(message, innerException) {}
		
		/// <summary>
		/// Initializes a new instance of the LoadPluginException class with
		/// an error message and a list of LoadPluginExceptions.
		/// </summary>
		/// <param name="message">
		/// A description of the list of LoadPluginExceptions.
		/// </param>
		/// <param name="exceptionList">
		/// A list of LoadPluginExceptions that occured during the loading of
		/// plugins.
		/// </param>
		public LoadPluginException(string message, List<LoadPluginException> exceptionList)
			: base(message)
		{
			this.exceptionList = exceptionList;
		}
		
		/// <value>
		/// Gets the list of LoadPluginExceptions that occured during the loading
		/// of plug-ins. This value will be null for the LoadPluginExceptions within
		/// the list, as well as if the LoadPluginException was thrown before any
		/// plug-ins were attempted loaded.
		/// </value>
		public List<LoadPluginException> ExceptionList
		{
			get
			{
				return exceptionList;
			}
		}
	}
}
